package com.yaozheng.vocationaltraining.view.userinfo;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.yaozheng.vocationaltraining.R;
import com.yaozheng.vocationaltraining.utils.TypeUtils;

import net.sf.json.JSONObject;

import org.androidannotations.annotations.EViewGroup;
import org.androidannotations.annotations.ViewById;

/**
 * 一项选中
 */
@EViewGroup(R.layout.item_listview_select)
public class ItemListViewSelectView extends LinearLayout {
    @ViewById
    TextView itemTextView;

    public ItemListViewSelectView(Context context) {
        super(context);
    }

    public ItemListViewSelectView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * 加载数据
     *
     * @param position
     * @param itemData
     */
    public void loadData(int position, JSONObject itemData) {
        itemTextView.setText(TypeUtils.getJsonString(itemData, "name"));
    }
}
